home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 40 / Amiga Format CD40 (1999-05-11)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-06].iso / -seriously_amiga- / misc / homebank / install-homebank < prev    next >
Text File  |  1999-03-24  |  10KB  |  269 lines

  1. ;********************************************************************
  2. ; HomeBank Installation Script
  3. ; $VER HomeBank-Install 1.3 (06.03.99)
  4. ; HomeBank © 1995-1999 by Maxime Doyen
  5. ;********************************************************************
  6.  
  7. ;********************************************************************
  8. ; System variables
  9. ;********************************************************************
  10. (set osver (/ (getversion) 65536))
  11.  
  12. (set cpu (database "cpu"))
  13. (if (= cpu 68000) (set #cpu 0)) (if (= cpu 68010) (set #cpu 1))
  14. (if (= cpu 68020) (set #cpu 2)) (if (= cpu 68030) (set #cpu 3))
  15. (if (= cpu 68040) (set #cpu 4)) (if (= cpu 68060) (set #cpu 5))
  16.  
  17. (set vernum1 (getversion "HomeBank"))
  18. (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  19. (set HomeBankver (cat ver1 "." rev1))
  20.  
  21. ;**************************************************************
  22. ; English strings
  23. ;**************************************************************
  24. (set #msg_welcome (cat "\nWelcome to HomeBank " HomeBankver "\n\nCopyright © 1995-1999 by\n\nMaxime Doyen\n<mdoyen@nordnet.fr>\nAll Rights Reserved\n\nhttp://home.nordnet.fr/~mdoyen/"))
  25. (set #msg_badkick (cat "\nSorry, this package requires OS v2.04 or better.\n"))
  26. (set #msg_nomui   (cat "\n\nHomeBank uses Magic User Interface (MUI).\n\nThe installer has not found MUI: to be assigned, therefore you AmIRC will not work correctly.  You will need to install MUI before running HomeBank."))
  27. (set #msg_nonlist (cat "\nWarning\n\nNList custom class\nseem not to be installed on your system,\n\nor need to be updated\nNList.mcc is © 1996-1999 Gilles Masson"))
  28. (set #msg_destdir (cat "Where do you wish to install HomeBank.\nA drawer called 'HomeBank' will be created there if one is not already there."))
  29. (set #msg_cats    (cat "What HomeBank language Catalog do you wish to install."))
  30. (set #msg_docs    (cat "What HomeBank Amigaguide® documentation do you wish to install."))
  31.  
  32. (set #reg_prompt "Thank you very much for purchasing `HomeBank'. To turn your demo version into a registered version, your personalized keyfile needs to be installed on your hard disk in the L: directory. Do you want to do that now (recommended)?")
  33. (set #reg_yes    "Yes, install keyfile")
  34. (set #reg_no     "No, don't install keyfile")
  35. (set #reg_help   "\nThe keyfile turns any `HomeBank' demo version into a registered version. After installation in the L: directory of your harddisk, all features will be enabled. The keyfile is personalized with your name and address and may not be redistributed under any circumstances.")
  36. (set #reg_noway  "\nYou choose not to install your keyfile. The options for registered users won't be enabled until you do that.\n\nYou can restart the installer script later or copy the keyfile manually with a command like\n\ncopy homebank.key L:")
  37.  
  38. ;**************************************************************
  39. ; Welcome message
  40. ;**************************************************************
  41. (message #msg_welcome (all))
  42. (welcome)
  43.  
  44. ;**************************************************************
  45. ; Test if MUI is installed and warn if not
  46. ;**************************************************************
  47. (if (< (exists "mui:" (noreq)) 2) (message #msg_nomui))
  48.  
  49. ;**************************************************************
  50. ; Get directory to put in
  51. ;**************************************************************
  52. (set destdir
  53.   (askdir
  54.     (prompt #msg_askdestdir)
  55.     (help @askdir-help)
  56.     (default "SYS:")
  57.   )
  58. )
  59.  
  60. (set @default-dest (expandpath destdir))
  61. (set destination (tackon destdir "HomeBank"))
  62.  
  63. (if (< (exists destination) 2) (makedir destination ))
  64. (if (exists "/HomeBank.info")
  65.   (copyfiles (source "/HomeBank.info") (dest @default-dest) (optional nofail force))
  66. )
  67.  
  68. (delete (tackon destination "Readme") (infos) (optional "force"))
  69. (delete (tackon destination "Orderform") (infos) (optional "force"))
  70. (delete (tackon destination "Docs") (all) (optional "force"))
  71. (delete (tackon destination "Docs.info") (optional "force"))
  72.  
  73. ;**************************************************************
  74. ; Copy/Update HomeBank Files
  75. ;**************************************************************
  76. (if (> #cpu 1)
  77.   (copyfiles (source "HomeBank020") (dest destination) (newname "HomeBank"))
  78.   (copyfiles (source "HomeBank") (dest destination))
  79. )
  80. (copyfiles (source "HomeBank.info") (dest destination) (optional "nofail"))
  81. (copyfiles (source "Registration") (dest destination) (infos))
  82. (copyfiles (source "HomeBank.readme") (dest destination) (infos))
  83. (copyfiles (source "Changes") (dest destination) (infos))
  84.  
  85. ;********************************************************************
  86. ; Copy/Update HomeBank Catalogs 
  87. ;********************************************************************
  88. (set lang 0)
  89. (if (exists "Catalogs")
  90. (
  91.   (set l11 "Deutsch (N/A)" )
  92.   (set l21 "Français (N/A)")
  93.   (set l31 "Norsk (N/A)"   )
  94.   (set l41 "Svenska (N/A)" )
  95.   (if (exists "Catalogs/deutsch/homebank.catalog" ) (set l11 "Deutsch" ) )
  96.   (if (exists "Catalogs/français/homebank.catalog") (set l21 "Français") )
  97.   (if (exists "Catalogs/norsk/homebank.catalog"   ) (set l31 "Norsk"   ) )
  98.   (if (exists "Catalogs/svenska/homebank.catalog" ) (set l41 "Svenska" ) )
  99.   (set lang
  100.     (askchoice
  101.       (choices l11 l21 l31 l41)
  102.       (prompt #msg_cats)
  103.       (help @askoptions-help)
  104.       (default 0)
  105.     )
  106.   )
  107.  
  108.   (if (< (exists (tackon destination "Catalogs")) 2)
  109.     (makedir (tackon destination "Catalogs"))
  110.   )    
  111.   (if (exists "Catalogs.info")
  112.     (copyfiles (source "Catalogs.info") (dest destination)) 
  113.   )
  114.  
  115.   (if (= lang 0)
  116.   (
  117.     (delete "LOCALE:Catalogs/deutsch/homebank.catalog")
  118.     (copyfiles (source "Catalogs/deutsch/homebank.catalog") (dest (tackon destination "Catalogs/deutsch")) (optional "nofail"))
  119.   )
  120.   )
  121.   (if (= lang 1)
  122.   (
  123.     (delete "LOCALE:Catalogs/français/homebank.catalog")
  124.     (copyfiles (source "Catalogs/français/homebank.catalog") (dest (tackon destination "Catalogs/français")) (optional "nofail"))
  125.   )
  126.   )
  127.   (if (= lang 2)
  128.   (
  129.     (delete "LOCALE:Catalogs/norsk/homebank.catalog")
  130.     (copyfiles (source "Catalogs/norsk/homebank.catalog") (dest (tackon destination "Catalogs/norsk")) (optional "nofail"))
  131.   )
  132.   )
  133.   (if (= lang 3)
  134.   (
  135.     (delete "LOCALE:Catalogs/svenska/homebank.catalog")
  136.     (copyfiles (source "Catalogs/svenska/homebank.catalog") (dest (tackon destination "Catalogs/svenska")) (optional "nofail"))
  137.   )
  138.   )
  139. )
  140. )
  141.  
  142. ;********************************************************************
  143. ; Copy/Update HomeBank AmigaGuide help
  144. ;********************************************************************
  145. (if (exists "HomeBank.guide.info")
  146.   (copyfiles (source "HomeBank.guide.info") (dest destination)) 
  147. )
  148.  
  149. (if (= lang 1)
  150.   (set guide 1)
  151.   (set guide 0)
  152. )
  153.  
  154. (set guide
  155.   (askchoice
  156.     (choices "English guide" "Français guide")
  157.     (prompt #msg_docs)
  158.     (help @askchoice-help)
  159.     (default guide)
  160.   )
  161. )
  162. (if (= guide 0)
  163.   (copyfiles (source "HomeBank.guide") (dest destination))
  164. )
  165. (if (= guide 1)
  166.   (copyfiles (source "Install/Français.guide") (dest destination) (newname "HomeBank.guide") (optional "nofail"))
  167. )
  168.  
  169. ;********************************************************************
  170. ; Copy/Update HomeBank Quick help
  171. ;********************************************************************
  172. (if (exists "HomeBank.quick")
  173.   (copyfiles (source "HomeBank.quick") (dest destination) (infos))
  174. )
  175.  
  176. (if (= lang 0)
  177.   (copyfiles (source "Install/Quick-Deutsch") (dest destination)  (newname "HomeBank.quick") (optional "nofail"))
  178. )
  179. (if (= lang 1)
  180.   (copyfiles (source "Install/Quick-Français") (dest destination)  (newname "HomeBank.quick") (optional "nofail"))
  181. )
  182. (if (= lang 2)
  183.   (copyfiles (source "Install/Quick-Norsk") (dest destination)  (newname "HomeBank.quick") (optional "nofail"))
  184. )
  185. (if (= lang 3)
  186.   (copyfiles (source "Install/Quick-Svenska") (dest destination)  (newname "HomeBank.quick") (optional "nofail"))
  187. )
  188.  
  189. ;**************************************************************
  190. ; Copy/Update Accounts directory
  191. ;**************************************************************
  192. (if (> (exists "Accounts") 0)
  193. (
  194.   (if (< (exists (tackon destination "Accounts")) 2)
  195.     (makedir (tackon destination "Accounts"))
  196.   )    
  197.   (if (exists "Accounts.info")
  198.     (copyfiles (source "Accounts.info") (dest destination)) 
  199.   )
  200.   (copyfiles (source "Accounts/Example.hb") (dest (tackon destination "Accounts")) (infos)) 
  201. )
  202. )
  203.  
  204. ;**************************************************************
  205. ; Copy/Update Icons directory
  206. ;**************************************************************
  207. (if (> (exists "Icons") 0)
  208. (
  209.   (if (< (exists (tackon destination "Icons")) 2)
  210.     (makedir (tackon destination "Icons"))
  211.   )    
  212.   (if (exists "Icons.info")
  213.     (copyfiles (source "Icons.info") (dest destination)) 
  214.   )
  215.   (copyfiles (source "Icons") (dest (tackon destination "Icons")) (all))
  216. )
  217. )
  218.  
  219. ;**************************************************************
  220. ; Copy/Update Goodies directory
  221. ;**************************************************************
  222. (if (> (exists "Goodies") 0)
  223. (
  224.   (if (< (exists (tackon destination "Goodies")) 2)
  225.     (makedir (tackon destination "Goodies"))
  226.   )    
  227.   (if (exists "Goodies.info")
  228.     (copyfiles (source "Goodies.info") (dest destination)) 
  229.   )
  230.   (copyfiles (source "Goodies") (dest (tackon destination "Goodies")) (all))
  231. )
  232. )
  233.  
  234. ;**************************************************************
  235. ; Check for NList.mcc, install or upgrade
  236. ;**************************************************************
  237. (set vernum 0)
  238. (set vernum (/ (getversion "MUI:Libs/mui/NList.mcc") 65536))
  239. (if (< vernum 19)
  240. (
  241.   (message #msg_nonlist)
  242.   (copylib (source "MUI/NList.mcc") (dest "MUI:Libs/mui"))
  243.   (copylib (source "MUI/NListview.mcc") (dest "MUI:Libs/mui"))
  244.   (copylib (source "MUI/NListviews.mcp") (dest "MUI:Libs/mui"))
  245. )
  246. )
  247.  
  248. ;**************************************************************
  249. ; Check if registered
  250. ;**************************************************************
  251. (if (exists "/homebank.key")
  252.   (
  253.     (if (askbool (prompt (cat #intro_0 "\n\n" #reg_prompt)) (choices #reg_yes #reg_no) (default 1) (help #reg_help))
  254.       (
  255.         (copyfiles
  256.       (prompt #reg_copying)
  257.           (source "/homebank.key")
  258.           (dest "L:")
  259.           (help @copyfiles-help)
  260.           (confirm "expert")
  261.         )
  262.       )
  263.       (
  264.         (message #reg_noway)
  265.       )
  266.     )
  267.   )
  268. )
  269.